echo "Try 'autopoint --help' for more information." 1>&2
exit 1 ;;
* )
break ;;
esac
done
}
# Command-line argument processing.
# Analyzes the remaining arguments.
{
if test $# -gt 0; then
func_usage 1>&2
exit 1
fi
}
srcdir=`pwd`
# The current directory is now $srcdir.
# Check integrity of package: A configure.in/ac must be present. Sets variable
# - configure_in name of configure.in/ac file.
if test -f configure.in; then
configure_in=configure.in
else
if test -f configure.ac; then
configure_in=configure.ac
else
# KDE specific convention: configure.in.in
if test -f configure.in.in; then
configure_in=configure.in.in
else
func_fatal_error "Missing configure.in or configure.ac, please cd to your package first."
fi
fi
fi
# Check whether the -V option and the version number in configure.in match.
# At least one of the two must be given. If both are given, they must agree.
xver=`cat "$configure_in" | grep '^AM_GNU_GETTEXT_VERSION(' | sed -e 's/^AM_GNU_GETTEXT_VERSION(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
if test -z "$xver" && test -f intl/VERSION; then
xver=`cat intl/VERSION | LC_ALL=C sed -n -e 's/^.*gettext-\([-+_.0-9A-Za-z]*\).*$/\1/p'`
fi
if test -n "$xver"; then
if test -n "$ver"; then
if test "X$ver" != "X$xver"; then
func_fatal_error "Version mismatch: specified -V $ver but the package uses gettext version $xver"
fi
else
ver="$xver"
fi
else
if test -z "$ver"; then
func_fatal_error "Missing version: please specify in $configure_in through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using"
m4/ ) destfile=`echo "$1" | sed -e "s,^m4/,$m4dir/,"` ;;
intl/ ) if test -n "$omitintl"; then destfile=""; else destfile="$1"; fi ;;
* ) destfile="$1" ;;
esac
}
# If some files have been locally modified and we have not been requested
# to overwrite them, then bail out. This is better than leaving a source
# package around where half of the files are locally modified and half are
# original - too great risk of version mismatch.
if test -z "$force"; then
mismatch=
func_tmpdir
mismatchfile="$tmp"/autopoint.diff
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
func_destfile "$file"
if test -n "$destfile"; then
if test -f "$destfile"; then
if cmp -s "$work_dir/archive/$file" "$destfile"; then
:
else
if test -n "$sharedowner"; then
echo "autopoint: warning: File $destfile has been locally modified." 1>&2
else
echo "autopoint: File $destfile has been locally modified." 1>&2
mismatch=yes
diff -c "$work_dir/archive/$file" "$destfile" | sed -e "1s,$work_dir/archive/,," >> "$mismatchfile"
fi
fi
fi
fi
done
if test -n "$mismatch"; then
rm -rf "$cvs_dir" "$work_dir"
func_fatal_error "Some files have been locally modified. Not overwriting them because --force has not been specified. For your convenience, you find the local modifications in the file '$mismatchfile'."
fi
rm -rf "$tmp"
fi
# func_mkdir_for to
# ensures the directory that would the given file exists.
# 'to' is a relative pathname, relative to the current directory.
func_mkdir_for ()
{
base=`echo "$1" | sed -e 's,/[^/]*$,,'`
if test "X$base" != "X$1" && test -n "$base"; then
func_mkdir_for "$base"
# Recompute base. It was clobbered by the recursive call.